﻿<navigation:Page 
        x:Class="PermDoc.PageDoc" 
        mc:Ignorable="d"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
        xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
        d:DesignWidth="1024"
        d:DesignHeight="1124"
        Title="PageDoc Page" 
        Loaded="Page_Loaded" Unloaded="Page_Unloaded"
    >


    <Grid x:Name="LayoutRoot" 
          Background="{StaticResource AppBackground}"
          >

        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Border Style="{StaticResource Floor}" Grid.RowSpan="2"/>

        <Border Style="{StaticResource ControlPanel}" 
                VerticalAlignment="Top" HorizontalAlignment="Left" >

            <StackPanel Orientation="Vertical" >

                <sdk:DataGrid 
                    x:Name="gv"
                    IsReadOnly="True"
                    SelectionMode="Single"
                    AutoGenerateColumns="False"
                    CanUserResizeColumns="False"
                    ItemsSource="_data"
                    Width="Auto" Height="300"
                    MinWidth="190" MinHeight="140"
                    MaxWidth="250" MaxHeight="300"
                    Margin="20"
                    VerticalAlignment="Top" HorizontalAlignment="Left"
                    VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" 
                    SelectionChanged="gv_SelectionChanged">

                    <sdk:DataGrid.Columns>

                        <sdk:DataGridTemplateColumn
                                Header="FileName" Width="160" Visibility="Visible">
                            <sdk:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate >
                                    <sdk:Label Content="{Binding FileName}"/>
                                </DataTemplate>
                            </sdk:DataGridTemplateColumn.CellTemplate>
                        </sdk:DataGridTemplateColumn>


                    </sdk:DataGrid.Columns>

                    <sdk:DataGrid.RowGroupHeaderStyles>
                        <!-- Style for groups at top level -->
                        <Style TargetType="sdk:DataGridRowGroupHeader">
                            <Setter Property="PropertyNameVisibility" Value="Collapsed" />
                            <Setter Property="Background" Value="#FF112255" />
                            <Setter Property="Foreground" Value="#FFEEEEEE" />
                            <Setter Property="SublevelIndent" Value="15" />
                        </Style>
                        <!-- Style for groups under the top level -->
                        <Style TargetType="sdk:DataGridRowGroupHeader">
                            <Setter Property="Background" Value="#44225566" />
                        </Style>
                    </sdk:DataGrid.RowGroupHeaderStyles>


                </sdk:DataGrid>

                <HyperlinkButton 
                    Name ="oBtnOpenFileInBrowser"
                    IsEnabled="False"
                    TargetName="_blank"
                    Content="Открыть файл в браузере" />
                <HyperlinkButton 
                    Name ="oBtnOpenDocInBrowser"
                    IsEnabled="False"
                    TargetName="_blank"
                    Content="Открыть документ в браузере" />
                <HyperlinkButton 
                    Name ="oBtnOpenDocInDeepZoom"
                    IsEnabled="False"
                    Content="DeepZoom" />

                <TextBlock 
                    Name="oTxtNo"
                    Text="{Binding Path=No, StringFormat='No - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocDate"
                    Text="{Binding Path=Дата_Док, Mode=OneWay, StringFormat='Дата док-тa - dd.MM.yyyy'}" />
                <TextBlock 
                    Name="oTxtDocCreated"
                    Text="{Binding Path=Создан, Mode=OneWay, StringFormat='Создан - dd.MM.yyyy hh:mm:ss'}" />
                <TextBlock 
                    Name="oTxtDocAuthor"
                    Text="{Binding Path=Автор, StringFormat='Автор - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocModify"
                    Text="{Binding Path=Изменён, Mode=OneWay, StringFormat='Изменён - dd.MM.yyyy hh:mm:ss'}" />
                <TextBlock 
                    Name="oTxtDocEditor"
                    Text="{Binding Path=Редактор, StringFormat='Редактор - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocState"
                    Text="{Binding Path=Статус, StringFormat='Статус - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocShop"
                    Text="{Binding Path=Магазин, StringFormat='Магазин - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocKontr"
                    Text="{Binding Path=Контрагент, StringFormat='Контрагент - \{0\}'}" />
                <TextBlock 
                    Name="oTxtDocNo_Doc"
                    Text="{Binding Path=N_Док, StringFormat='N_Док - \{0\}'}" />                

            </StackPanel>

        </Border>

        <Border 
            Name="button1" 
            Style="{StaticResource Frame}"
            HorizontalAlignment="Center"
            MouseMove="Border_MouseMove"
            MouseLeftButtonDown="Button_MouseLeftButtonDown">

            <Border 
                Name="PlaceHolder" 
                BorderThickness="3" BorderBrush="Silver" Background="#0FFF">
                <Border Name="ChildHolder" >
                    <Image 
                        x:Name="oImage" 
                        Source="http://sp.korablik.local/images/download.jpg" 
                        />
                </Border>
            </Border>

        </Border>        

        

    </Grid>        
        
        <!--
        <StackPanel Margin="35" Background="Gray" Orientation="Horizontal">

            <StackPanel 
                Height="350" Width="50" 
                Margin="0" Background="AliceBlue">
                <StackPanel.Projection>
                    <PlaneProjection RotationX="0" RotationY="-55" RotationZ="0"  />
                </StackPanel.Projection>
                <TextBlock Margin="10">Type Something Below</TextBlock>
                <TextBox Margin="10"></TextBox>
                <Button Margin="10" Content="Click" Width="100" />
            </StackPanel>

            <StackPanel 
                Height="350" Width="150" 
                Margin="0" Background="AliceBlue">
                <StackPanel.Projection>
                    <PlaneProjection RotationX="0" RotationY="-35" RotationZ="0"  />
                </StackPanel.Projection>
                <TextBlock Margin="10">Type Something Below</TextBlock>
                <TextBox Margin="10"></TextBox>
                <Button Margin="10" Content="Click" Width="100" />
            </StackPanel>

            <StackPanel 
                Height="350" Width="350" 
                Margin="0" Background="AliceBlue">

                <StackPanel.Projection>
                    <PlaneProjection RotationX="0" RotationY="0" RotationZ="0"  />
                </StackPanel.Projection>

                <TextBlock Margin="10">Type Something Below</TextBlock>
                <TextBox Margin="10"></TextBox>
                <Button Margin="10" Content="Click" Width="100" />
            </StackPanel>

            <StackPanel 
                Height="350" Width="150" 
                Margin="0" Background="AliceBlue">
                <StackPanel.Projection>
                    <PlaneProjection RotationX="0" RotationY="35" RotationZ="0"  />
                </StackPanel.Projection>
                <TextBlock Margin="10">Type Something Below</TextBlock>
                <TextBox Margin="10"></TextBox>
                <Button Margin="10" Content="Click" Width="100" />
            </StackPanel>

            <StackPanel 
                Height="350" Width="50" 
                Margin="0" Background="AliceBlue">
                <StackPanel.Projection>
                    <PlaneProjection RotationX="0" RotationY="55" RotationZ="0"  />
                </StackPanel.Projection>
                <TextBlock Margin="10">Type Something Below</TextBlock>
                <TextBox Margin="10"></TextBox>
                <Button Margin="10" Content="Click" Width="100" />
            </StackPanel>

        </StackPanel>
        -->

</navigation:Page>
